<template>
	<view class="list_block">
		<block v-if="list.length">
			<view class="list" v-for="item in list" :key="item.id">
				<view class="list_box">
					<view>{{item.name}}</view>
					<text>{{$fomartDate(item.createtime).substring(0,10)}}</text>
				</view>
				<view class="list_box1">
					<view class="goods_name">
						{{item.order_num?'订单号:'+item.order_num:''}}
					</view>
					<view class="list_integral" :style="item.num>0?'':'color:#f00'">
						{{item.num>0?'+':''}}{{$fixed(item.num)}}
					</view>
				</view>
			</view>
		</block>
		<view v-else class="bitmap">
			<image src="/static/img/no_content.png" mode="widthFix"></image>
			<view>暂时没有订单哦~</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				page: 1

			}
		},
		methods: {
			getList() {
				this.$get(this.$api.dDetailed, {
					page: this.page
				}, (res) => {
					let {
						data
					} = res;
					if (data.code == 1) {
						this.list = this.list.concat(data.data.data)
					}
				})
			}
		},
		onLoad() {
			this.getList();
		},
		onReachBottom() {
			this.page++;
			this.getList()
		}
	}
</script>

<style scoped>
	.bitmap {
		text-align: center;
		padding-top: 100rpx;
	}

	.bitmap image {
		width: 60%;
	}

	.bitmap view {
		color: gray;
		font-size: 26rpx;
		margin-top: 30rpx;
	}

	.list_block {
		min-height: 100vh;
		background: white;
		width: 100%;
		padding: 0 30rpx;
		box-sizing: border-box;
	}

	.list {
		width: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		/* justify-content: space-between; */
		border-bottom: 2rpx solid #eee;
		padding: 30rpx 0;
	}

	.list_box {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 30rpx;
	}

	.list_box1 {
		width: 100%;
		display: flex;
		justify-content: space-between;
		align-items: center;
		/* margin: 15rpx 0; */
	}

	.goods_name {
		width: 550rpx;
		overflow: hidden;
		white-space: nowrap;
		text-overflow: ellipsis;
	}

	/* .list_box view{
  font-size: 30rpx;
  color: #000000;
  margin-bottom:20rpx;
}*/
	.list_box text {
		font-size: 26rpx;
		/* color: #999999; */
	}

	.list_integral {
		font-size: 36rpx;
		color: #333333;
	}
</style>
